//菜单树
var menu_setting = {
		check:{
			enable:false
//			chkStyle:"checkbox",
//			chkboxType:{"Y":"s","N":"s"}
		},
		data:{
			simpleData:{
				enable:true
			}
		},
		view:{
			showLine:false,
			dblClickExpand:true,
			fontCss:setFontCss_ztree
		},
		callback:{
			onClick:menuzTreeClick
		}
};

//添加菜单(所属父类)
var menuSort_setting = {
		check:{
			enable:false
//			chkStyle:"radio"
//			chkboxType:{"Y":"s","N":"s"}
		},
		data:{
			simpleData:{
				enable:true
			}
		},
		view:{
			showLine:false,
			dblClickExpand:true,
			fontCss:setFontCss_ztree
		},
		callback:{
			onClick:parentMenuzTreeOnClick
		}
};

//编辑菜单(所属父类)
var menuSortEdit_setting = {
		check:{
			enable:false
//			chkStyle:"checkbox",
//			chkboxType:{"Y":"s","N":"s"}
		},
		data:{
			simpleData:{
				enable:true
			}
		},
		view:{
			showLine:false,
			dblClickExpand:true,
			fontCss:setFontCss_ztree
		},
		callback:{
			onClick:parentEditMenuzTreeOnClick
		}
};

//添加的菜单权限
var authority_setting = {
    check: {
        enable: true,
        chkboxType:  { "Y" : "", "N" : "" }
    },
    view: {
        dblClickExpand: false
    },
    data: {
        simpleData: {
            enable: true
        }
    },
    callback: {
        onCheck: authorityzTreeOnCheck("authority","operateAuthorityId")
    }
};
//添加菜单（查看权限树配置）
var menuLookAuthority_setting = {
    check: {
        enable: true,
        chkboxType:  { "Y" : "", "N" : "" },
        chkStyle: "radio"
    },
    view: {
        dblClickExpand: false
    },
    data: {
        simpleData: {
            enable: true
        }
    },
    callback: {
        onCheck: menuAuthorityzTreeOnCheck("menuLookAuthority","authorityId")
    }
};
//编辑菜单（查看权限树配置）
var menuLookAuthorityEdit_setting = {
	check: {
        enable: true,
        chkboxType:  { "Y" : "", "N" : "" },
        chkStyle: "radio"
    },
    view: {
        dblClickExpand: false
    },
    data: {
        simpleData: {
            enable: true
        }
    },
    callback: {
    	onCheck: menuLookAuthorityEditzTreeCheck("menuLookAuthorityEdit","menuLookAuthorityIdEdit")
    }
}

//编辑的菜单权限
var authorityEdit_setting = {
    check: {
        enable: true,
        chkboxType:  { "Y" : "", "N" : "" }
    },
    view: {
        dblClickExpand: false
    },
    data: {
        simpleData: {
            enable: true
        }
    },
    callback: {
        onCheck: authorityEditzTreeOnCheck("authorityEdit","operateAuthorityIdEdit")
    }
};

var zTree, menuzTree,editzTree,menuParentTree,menuLookzTree,menuLookAuthorityzTree,authorityTree,authorityEditTree;
var parentMenuName,parentMenuId;
$(function () {
	//自动获取树控件高度
	autoZTreeHeight();
	//设置宽度
	var rightDivW=getWindowWith()-$(".nav").width()-30;
	$(".table_title_div").css("width",rightDivW+"px");
	//初始化获取所有菜单
	initGetMenu();
	//初始化添加菜单所属分类
	initParentMenu();
	//初始化编辑菜单所属分类
	initEditParentMenu();
	//添加菜单（查看权限）
	initMenuLookAuthority();
	//编辑菜单（查看权限）
	initMenuLookAuthorityEdit();
	//菜单操作权限
	initMenuAuthority();
	//初始化编辑菜单权限
	initEditMenuAuthority();
	
	$("#title").text("菜单管理");
	
	 //去除所有控件的虚线框
    removeBlur();
});

//获取所有菜单
function initGetMenu(){
	$.post(
		getPath() + "base/getMenuAsTree",{parentId:0},
		 function(data){
			 var treeNodes = data;
			 result = eval("("+treeNodes+")");
			 if(result.isSuccess){
				 resultObj = result.resultObject;
				 resultObj.splice(0,1);
				 menuzTree = $.fn.zTree.init($("#menuTree"),menu_setting,resultObj);
			 }
	 });
}

//添加菜单(所属分类)
function initParentMenu(){
	$("#menuParentName").bind("click", {menuContentId:"parentMenu"}, showMenu).bind(
			"focus", function(){
				menuParentTree.expandNode(menuParentTree.getNodeByTId("1"), true);
				//取消所有已勾选的节点
				menuParentTree.checkAllNodes(false);
				var parentMenuNode = menuParentTree.getNodeByParam("id", parentMenuId);
				//menuParentTree.checkNode(parentMenuNode, true, false);
				menuParentTree.selectNode(parentMenuNode, false);
	});
	
	$.post(getPath() + "base/getMenuAsTree",{parentId:0},
	         function(result){
				if(result.isSuccess){
					var treeNodes = result.resultObject;
					menuParentTree = $.fn.zTree.init($("#parentMenuTree"),menuSort_setting,treeNodes);  
				}
	},"json");
}

//编辑菜单(所属分类)
function initEditParentMenu(){
	$("#menuParentNameEdit").click({menuContentId:"parentEditMenu"}, showMenu);
	$.post(getPath() + "base/getMenuAsTree",{parentId:0},
	         function(result){
				if(result.isSuccess){
					var treeNodes = result.resultObject;
					editzTree = $.fn.zTree.init($("#parentEditMenuTree"),menuSortEdit_setting,treeNodes);
				}
	},"json");
}

//添加菜单（查看权限树） lrs
function initMenuLookAuthority(){
	$("#menuLookAuthority").click({menuContentId:"menuLookAuthorityDiv"}, showMenu);
	$.post(getPath() + "base/getMenuLookAuthorityAsTree",{},
			function(result){
				if(result.isSuccess){
					var treeNodes = result.resultObject; 
					menuLookzTree = $.fn.zTree.init($("#menuLookAuthorityTree"),menuLookAuthority_setting,treeNodes);  
				}
	},"json");
}

//编辑菜单（查看权限树）
function initMenuLookAuthorityEdit(){
	$("#menuLookAuthorityEdit").bind("click", {menuContentId:"menuLookAuthorityEditDiv"}, showMenu).bind(
			"focus", function(){
				menuLookAuthorityzTree.expandNode(menuLookAuthorityzTree.getNodeByTId("1"), true);
				//取消所有已勾选的节点
				menuLookAuthorityzTree.checkAllNodes(false);
				//获取查看权限的id值
				var menuLookAuthorityId = $("#menuLookAuthorityIdEdit").val();
				var menuLookAuthorityNode = menuLookAuthorityzTree.getNodeByParam("id", menuLookAuthorityId);
				menuLookAuthorityzTree.checkNode(menuLookAuthorityNode, true, false);
	});
	$.post(getPath() + "base/getMenuLookAuthorityAsTree",{},
			function(result){
		if(result.isSuccess){
			var treeNodes = result.resultObject;
			menuLookAuthorityzTree = $.fn.zTree.init($("#menuLookAuthorityEditTree"),menuLookAuthorityEdit_setting,treeNodes);
		}
	},"json");
}

//添加菜单（显示操作权限树） lrs
function initMenuAuthority(){
	$("#authority").click({menuContentId:"menuAuthority"}, showMenu);
	$.post(getPath() + "base/getAuthorityAsTree",{pid:0},
			function(result){
				if(result.isSuccess){
					var treeNodes = result.resultObject;
					authorityTree = $.fn.zTree.init($("#MenuAuthorityTree"),authority_setting,treeNodes);  
				}
	},"json");
}

//编辑菜单（显示操作权限树）
function initEditMenuAuthority(){
	$("#authorityEdit").bind("click", {menuContentId:"menuEditAuthority"}, showMenu)
				.bind("focus", function() {
					authorityEditTree.expandNode(authorityEditTree.getNodeByTId("1"), true);
					//取消所有已勾选的节点
					authorityEditTree.checkAllNodes(false);
					var authorityIds = $("#operateAuthorityIdEdit").val();
						authorityIdsArr = authorityIds.split(","),
						node = null;
					for(var i=0; i<authorityIdsArr.length; i++) {
						node = authorityEditTree.getNodeByParam("id", authorityIdsArr[i]);
						authorityEditTree.checkNode(node, true, false);
					}
				});
	
	$.post(getPath() + "base/getAuthorityAsTree",{pid:0},
	         function(result){
				if(result.isSuccess){
					var treeNodes = result.resultObject;
					authorityEditTree = $.fn.zTree.init($("#MenuEditAuthorityTree"),authorityEdit_setting,treeNodes);
				}
	},"json");
}
//添加菜单
function add(){
	$("#addDialog").css("display","block");
	$("#editDialog").css("display","none");
	$("#title").text("添加菜单");
	$("#label").val("");
	//所属父类默认选中已选菜单
//	var menuParentNode = menuParentTree.getNodeByParam("id", menuId);
//	menuParentTree.checkNode(menuParentNode, true, false);
	$("#menuParentName").val(parentMenuName);
	$("#parentId").val(parentMenuId);
	$("#className").val("");
	$("#url").val("");
	$("#controlHeight").val("");
	$("#sortFlag").val("");
	$("#authority").val("");
	$("#operateAuthorityId").val("");
	$("#remark").val("");
	
}
//删除菜单
function deleteMenu(){
	var selectedMenuArr = menuzTree.getSelectedNodes();
	//var selectedArray = menuzTree.getSelectedNodes();
	if(selectedMenuArr.length == 0){
        var promptWindow = $("<div><p style='margin: 5px;'>请选择需要删除的菜单！</p></div>");
        promptWindow.appendTo("html");
        promptWindow.dialog({
            autoOpen: true,
            width: 200,
            height: 150,
            resizable: false,
            title: "系统提示",
            modal: true,
            buttons: {
                "确定":function(){
                    $(this).dialog("close");
                }
            }
        }); 
	}else{
		var menuIds = "";
		//获取菜单ids
		for(var i=0;i<selectedMenuArr.length;i++){
			if(menuIds.length == 0){
				menuIds += selectedMenuArr[i].id;
			}else{
				menuIds += ","+selectedMenuArr[i].id;
			}
		}
		$.post(getPath() + "base/deleteMenu" ,{menuIds:menuIds},
		   function(result){
                if(result.isSuccess){
                    //删除成功，弹出添加成功提示框，当用户点击确定后刷新页面                   
                    var promptWindow = openDialog("删除成功！","base/showMenuManageView");
                    promptWindow.dialog("open");
                }
		   },"json");
	}

}
//保存添加菜单
function save(){
	//声明消息提示
    var toolTips = new Object();
    //设置表单验证
    var validator = $("#addForm").validate({
        rules:{
        	label:"required",
        	className:"required",
        	controlHeight:"required",
        	sortFlag:"required",
        	menuLookAuthority:"required",
        	authority:"required"
        },
        messages:{
        	label:"请输入菜单名称",
        	className:"请输入菜单样式",
        	controlHeight:"请输入菜单高度",
        	sortFlag:"请输入菜单序号",
        	menuLookAuthority:"请选择查看权限",
        	authority:"请选择操作权限"
        },
        errorPlacement: function(eror,element){
            var toolTip = createTooltip(toolTips,element.attr("id"));
            toolTip.setContent(eror.text());
            element.addClass("error-border");

        },
        success:function(label){
            var elementId = label.attr("id").substring(0,label.attr("id").length - 6);
            var toolTip = toolTips[elementId];
            $("#" + elementId).removeClass("error-border");
            toolTip.close();
            toolTip.detach();
        },
        submitHandler:function(form){
        	$.post(getPath() + "base/addMenu/"+$("#operateAuthorityId").val(),
        			$("#addForm").serialize(),
                    function(data){
                	 var result = eval("(" + data + ")");
                     if(result.isSuccess){
                    	 var promptWindow = openDialog("添加成功！","base/showMenuManageView");
                    	 promptWindow.dialog("open");
                     }else{
                    	 alert(result.resultObject);
                     }
        	});
       }
    })
}

//保存编辑菜单
function saveEdit(){
	//声明消息提示
    var toolTips = new Object();
    //设置表单验证
    var validator = $("#updateForm").validate({
        rules:{
        	label:"required",
        	className:"required",
        	url:"required",
        	controlHeight:"required",
        	sortFlag:"required"
        },
        messages:{
        	label:"请输入菜单名称",
        	className:"请输入菜单样式",
        	url:"请输入菜单链接",
        	controlHeight:"请输入菜单高度",
        	sortFlag:"请输入菜单序号"
        },
        errorPlacement: function(eror,element){
            var toolTip = createTooltip(toolTips,element.attr("id"));
            toolTip.setContent(eror.text());
            element.addClass("error-border");

        },
        success:function(label){
            var elementId = label.attr("id").substring(0,label.attr("id").length - 6);
            var toolTip = toolTips[elementId];
            $("#" + elementId).removeClass("error-border");
            toolTip.close();
            toolTip.detach();
        },
        submitHandler:function(form){
        	var selectNodeArr = menuzTree.getSelectedNodes();
        	var lastNodeIndex = selectNodeArr.length - 1;
        	var menuId = selectNodeArr[lastNodeIndex].id; //取最后菜单节点的id
        	var operateAuthorityIdEditCopy = $("#operateAuthorityIdEditCopy").val();
        	$.post(getPath() + "base/saveEditMenu/"+$("#operateAuthorityIdEdit").val()+"/"+menuId+"/"+operateAuthorityIdEditCopy,
        			$("#updateForm").serialize(),
                    function(result){
                     if(result.isSuccess){
                    	 var promptWindow = openDialog("更新成功！","base/showMenuManageView");
                    	 promptWindow.dialog("open");
                     }else{
                    	 alert(result.resultObject);
                     }
        	}, "json")
       }
    })
}
//菜单树的点击事件
function menuzTreeClick(event,treeId,treeNode){
	$("#addDialog").css("display","none");
	$("#editDialog").css("display","block");
	$("#title").text("编辑菜单");
	//获取父菜单名，父菜单id为全局变量
	parentMenuName = treeNode.name;
	parentMenuId = treeNode.id;
	$.post(getPath() + "base/editMenu?menuId="+treeNode.id,
			function(result){
			if(result.isSuccess){
				resultObj = result.resultObject;
				var operateAuthorityName="";
				var operateAuthorityId="";
				var operateAuthorityArr = resultObj.operateAuthorityList;
				for(var i=0;i<operateAuthorityArr.length;i++){
					if(i<operateAuthorityArr.length-1){
						operateAuthorityName += operateAuthorityArr[i].name + ",";
						operateAuthorityId += operateAuthorityArr[i].id + ",";
					}else{
						operateAuthorityName += operateAuthorityArr[i].name;
						operateAuthorityId += operateAuthorityArr[i].id;
					}
				}
				
				var baseMenu = resultObj.baseMenu;
				var parentId = resultObj.baseMenu.parentId;
				var menuLookAuthority = resultObj.menuLookAuthority;
				//菜单名
				$("#labelEdit").val(baseMenu.label);
				//所属父类
				if(parentId == 0){
					$("#menuParentNameEdit").val("无");
					$("#parentIdEdit").val(parentId);
				}else{
					//如果不是子菜单的话就没返回parentMenu
					$("#menuParentNameEdit").val(resultObj.parentMenu.label);
					$("#parentIdEdit").val(parentId);
				}
				//获取所属分类的parentId值
				var parentIdEdit = $("#parentIdEdit").val();
				var parentNode = editzTree.getNodeByParam("id", parentIdEdit);
				editzTree.selectNode(parentNode, false);
				
				//菜单样式
				$("#classNameEdit").val(baseMenu.className);
				//菜单url
				$("#urlEdit").val(baseMenu.url);
				//菜单高度
				$("#controlHeightEdit").val(baseMenu.controlHeight);
				//菜单序号
				$("#sortFlagEdit").val(baseMenu.sortFlag);
				//查看权限
				$("#menuLookAuthorityEdit").val(menuLookAuthority.name);
				$("#menuLookAuthorityIdEdit").val(menuLookAuthority.id);
				//操作权限
				$("#authorityEdit").val(operateAuthorityName);
				$("#operateAuthorityIdEdit").val(operateAuthorityId);
				//操作权限ids备份一份下来，更新权限的时候用
				$("#operateAuthorityIdEditCopy").val(operateAuthorityId);
				//备注
				$("#remarkEdit").val(baseMenu.remark);
			}
	}, "json");
}

function parentMenuzTreeOnClick(event,treeId,treeNode){
	$("#menuParentName").val(treeNode.name);
	if(treeNode.id == -1){
		$("#parentId").val(0);
	}else{
		$("#parentId").val(treeNode.id);
	}
}

function parentEditMenuzTreeOnClick(event,treeId,treeNode){
	$("#menuParentNameEdit").val(treeNode.name);
	if(treeNode.id == -1){
		$("#parentIdEdit").val(0);
	}else{
		$("#parentIdEdit").val(treeNode.id);
	}
}


//操作成功后的弹窗
function openDialog(tipInfo, src){
	var promptWindow = $("<div style='overflow-y: hiddern;'><p style='margin: 5px;'>"+tipInfo+"</p></div>");
    promptWindow.appendTo("html");
    promptWindow.dialog({
        autoOpen: false,
        width: 200,
        height: 130,
        resizable: false,
        title: "系统提示",
        modal: true,
        buttons: {
            "确定": function () {
                window.location.href = getPath() + src;
            }
        }
    });
    return promptWindow;
}
/**
 * 添加菜单(查看权限)选择改变，改变输入框的显示
 * @param attachTargetId 触发事件的id，用于显示名称等文本
 * @param targetId 目标id，用于显示id，提交到后台
 */
function menuAuthorityzTreeOnCheck(attachTargetId, targetId){
    return function onCheck(e, treeId, treeNode) {
        var zTree = $.fn.zTree.getZTreeObj(treeId),
            nodes = zTree.getCheckedNodes(true),
            v = "", ids = "";
        for (var i=0, l=nodes.length; i<l; i++) {
            v += nodes[i].name + ",";
            ids += nodes[i].id + ",";
        }
        if (v.length > 0 ) v = v.substring(0, v.length-1);
        if (ids.length > 0 ) ids = ids.substring(0, ids.length-1);
        var cityObj = $("#" + attachTargetId);
        cityObj.val(v);
        $("#" + targetId).val(ids);
    };
}
/**
 * 编辑菜单（查看权限）选择改变
 * @param attachTargetId
 * @param targetId
 */
function menuLookAuthorityEditzTreeCheck(attachTargetId, targetId){
	return function onCheck(e, treeId, treeNode) {
        var zTree = $.fn.zTree.getZTreeObj(treeId),
            nodes = zTree.getCheckedNodes(true),
            v = "", ids = "";
        for (var i=0, l=nodes.length; i<l; i++) {
            v += nodes[i].name + ",";
            ids += nodes[i].id + ",";
        }
        if (v.length > 0 ) v = v.substring(0, v.length-1);
        if (ids.length > 0 ) ids = ids.substring(0, ids.length-1);
        var cityObj = $("#" + attachTargetId);
        cityObj.val(v);
        $("#" + targetId).val(ids);
    };
}

/**
 * 添加权限选择改变，改变输入框的显示
 * @param attachTargetId 触发事件的id，用于显示名称等文本
 * @param targetId 目标id，用于显示id，提交到后台
 */
function authorityzTreeOnCheck(attachTargetId, targetId){
    return function onCheck(e, treeId, treeNode) {
        var zTree = $.fn.zTree.getZTreeObj(treeId),
            nodes = zTree.getCheckedNodes(true),
            v = "", ids = "";
        for (var i=0, l=nodes.length; i<l; i++) {
            v += nodes[i].name + ",";
            ids += nodes[i].id + ",";
        }
        if (v.length > 0 ) v = v.substring(0, v.length-1);
        if (ids.length > 0 ) ids = ids.substring(0, ids.length-1);
        var cityObj = $("#" + attachTargetId);
        cityObj.val(v);
        $("#" + targetId).val(ids);
    };
}

/**
 * 编辑权限选择改变，改变输入框的显示
 * @param attachTargetId 触发事件的id，用于显示名称等文本
 * @param targetId 目标id，用于显示id，提交到后台
 */
function authorityEditzTreeOnCheck(attachTargetId, targetId){
    return function onCheck(e, treeId, treeNode) {
        var zTree = $.fn.zTree.getZTreeObj(treeId),
            nodes = zTree.getCheckedNodes(true),
            v = "", ids = "";
        for (var i=0, l=nodes.length; i<l; i++) {
            v += nodes[i].name + ",";
            ids += nodes[i].id + ",";
        }
        if (v.length > 0 ) v = v.substring(0, v.length-1);
        if (ids.length > 0 ) ids = ids.substring(0, ids.length-1);
        var cityObj = $("#" + attachTargetId);
        cityObj.val(v);
        $("#" + targetId).val(ids);
    };
}


/**
 * 设置树节点字体样式
 */
function setFontCss_ztree(treeId, treeNode) {
	if (treeNode.isParent == false){
		//叶子节点
		return (!!treeNode.highlight) ? {color:"#ff0000", "font-weight":"bold"} : {color:"#666666", "font-weight":"normal"};
	} else {
		//父节点
		return (!!treeNode.highlight) ? {color:"#ff0000", "font-weight":"bold"} : {color:"#666666", "font-weight":"bold"};
	}
}

/**
 * 树查询,高亮显示并展示【模糊匹配搜索条件的树节点】
 * @author chm
 * @param treeId 树id
 * @param searchId 查询文本框的id
 */
function search_ztree(treeId,searchId){
	searchByFlag_ztree(treeId, searchId, "");
}

/**
 * 搜索树，高亮显示并展示【模糊匹配搜索条件的节点s】
 * @param treeId
 * @param searchConditionId		搜索条件Id
 * @param flag 					需要高亮显示的节点标识
 */
function searchByFlag_ztree(treeId, searchId, flag){
	//<1>.搜索条件
	var searchCondition = $('#'+searchId).val();
	//<2>.得到模糊匹配搜索条件的节点数组集合
	var highlightNodes = new Array();
	if(searchCondition != ""){
		var treeObj = $.fn.zTree.getZTreeObj(treeId);
		highlightNodes = treeObj.getNodesByParamFuzzy("name",searchCondition);
	}
	highlightAndExpand_ztree(treeId, highlightNodes,flag);
}
/**
 * 高亮显示并展示【指定节点】
 * @param treeId
 * @param highlightNodes 需要高亮显示的节点数组
 * @param flag			 需要高亮显示的节点标识
 */
function highlightAndExpand_ztree(treeId, highlightNodes,flag){
	var treeObj = $.fn.zTree.getZTreeObj(treeId);
	//<1>. 先把全部节点更新为普通样式
	var treeNodes = treeObj.transformToArray(treeObj.getNodes());
	for (var i = 0; i < treeNodes.length; i++) {
		treeNodes[i].highlight = false;
		treeObj.updateNode(treeNodes[i]);
	}
	//<2>.收起树, 只展开根节点下的一级节点
	close_ztree(treeId);
	//<3>.把指定节点的样式更新为高亮显示，并展开
	if (highlightNodes != null) {
		for (var i = 0; i < highlightNodes.length; i++) {
			//高亮显示节点，并展开
			highlightNodes[i].highlight = true;
			treeObj.updateNode(highlightNodes[i]);
			//高亮显示节点的父节点的父节点....直到根节点，并展示
			var parentNode = highlightNodes[i].getParentNode();
			var parentNodes = getParentNodes_ztree(parentNode);
			treeObj.expandNode(parentNodes, true, false, true);
			treeObj.expandNode(parentNode, true, false, true);
		}
	}
}

/**
 * 收起树：只展开根节点下的一级节点
 * @param treeId
 */
function close_ztree(treeId){
    var treeObj = $.fn.zTree.getZTreeObj(treeId);
    var nodes = treeObj.transformToArray(treeObj.getNodes());
    var nodeLength = nodes.length;
    for (var i = 0; i < nodeLength; i++) {
        if (nodes[i].id == '0') {
            //根节点：展开
            treeObj.expandNode(nodes[i], true, true, false);
        } else {
            //非根节点：收起
            treeObj.expandNode(nodes[i], false, true, false);
        }
    }
}

/**
 * 递归得到指定节点的父节点的父节点....直到根节点
 */
function getParentNodes_ztree(node){
	var parentNode = node.getParentNode();
	if (parentNode != null) {
		//var treeObj = $.fn.zTree.getZTreeObj(treeId);
		return getParentNodes_ztree(parentNode);
	} else {
		return node;
	}
}

/**
 * 设置树节点字体样式
 */
function setFontCss_ztree(treeId, treeNode) {
	if (treeNode.isParent == false){
		//叶子节点
		return (!!treeNode.highlight) ? {color:"#ff0000", "font-weight":"bold"} : {color:"#666666", "font-weight":"normal"};
	} else {
		//父节点
		return (!!treeNode.highlight) ? {color:"#ff0000", "font-weight":"bold"} : {color:"#666666", "font-weight":"bold"};
	}
}


